<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>综合DEMO</title>

    <!-- Bootstrap -->
    <link href="{:config('__public__')}/static/bootstrap-3.3.4/dist/css/bootstrap.min.css" rel="stylesheet">

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="http://cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script src="http://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>
<body>
	<div class="main-title">
		<h2>综合DEMO</h2>
	</div>
    <div class="container">
    <form action="{:url('test')}" enctype="application/x-www-form-urlencoded" method="POST"
            class="form-horizontal">
        <div class="form-group">
            <label class="col-sm-12">
                test
            </label>
            <div class="col-lg-6">
                <input type="text" name="test" required="required">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-12">开始时间</label>
            <div class="col-lg-6">
            <input type="text" class="text timestr" name="begin_time" value="">
            </div>
        </div>
        <div class="form-group">
            <label for="auth-title" class="col-sm-12">用户组</label>
            <div class="col-lg-6">
                <input id="auth-title" type="text" name="title" class="form-control" value="" required="required"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-12">上传图片</label>
            <div class="row" style="padding: 12px; width: 95%;">
            <div class=" col-lg-4">
            <input class="form-control" type="file" id="file1" name="file1" />
            </div>
            <div class="col-lg-1">
            <input class="btn btn-sm" type="button" value="上传" />
            </div>
            <div class="col-sm-6"><img id="img1" alt="" src="" /></div>
            </div>
        </div>
        <div class="form-group">
            <label for="auth-description" class="col-sm-12">描述</label>
            <div class="col-lg-6">
                <textarea class="form-control" rows="3" id="auth-description" type="text" name="description" required="required"></textarea>
            </div>
        </div>

        <div class="form-group">
            <label for="content" class="col-sm-12">内容</label>
            <div class="col-lg-6">
                <textarea class="form-control" type="text" id="content" name="content" style="width:1000px;height:240px;"></textarea>
            </div>
        </div>

        <div class="form-group">
            <input type="hidden" name="id" value="" />
            <button type="submit" class="btn submit-btn ajax-post" target-form="form-horizontal">确 定</button>
            <button class="btn btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>
        </div>
    </form>
    </div>
    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
    <script src="http://cdn.bootcss.com/jquery/1.11.1/jquery.min.js"></script>
    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <script src="{:config('__public__')}/static/bootstrap-3.3.4/dist/js/bootstrap.min.js"></script>
    <script src="{:config('__public__')}/static/jquery-validation-1.16.0/dist/jquery.validate.min.js"></script>
    <script src="{:config('__public__')}/static/form-3.51/jquery.form.js"></script>
    
    <link rel="stylesheet" href="{:config('__public__')}/static/artDialog-6.0.4/css/ui-dialog.css">
    <script src="{:config('__public__')}/static/artDialog-6.0.4/dist/dialog-min.js"></script>
   
    <script type="text/javascript" src="/Admin/js/ajaxSubmit.js"></script>

    <link href="{:config('__public__')}/static/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
    <link href="{:config('__public__')}/static/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="/static/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
    <script type="text/javascript" src="/static/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>


    <script type="text/javascript">
        // window.UMEDITOR_HOME_URL = '/uploadFile/haha.html';
    </script>
    <link href="{:config('__public__')}/static/UMeditor-utf8-php/themes/default/css/umeditor.css" type="text/css" rel="stylesheet">
    <!-- <script type="text/javascript" src="third-party/jquery.min.js"></script> -->
    <script type="text/javascript" charset="utf-8" src="/static/UMeditor-utf8-php/umeditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="/static/UMeditor-utf8-php/umeditor.min.js"></script>
    <script type="text/javascript" src="/static/UMeditor-utf8-php/lang/zh-cn/zh-cn.js"></script>
    <script type="text/javascript">
        // window.UMEDITOR_CONFIG.imageUrl = '/index.php?s=/pub/fileUpload';
        // window.UMEDITOR_CONFIG.imagePath = 'php/';
        // window.UMEDITOR_CONFIG.imageFieldName = 'upfile';
        

        var um = UM.getEditor('content');
    </script>


    <script type="text/javascript">
        
        $(function(){
           $('.timestr').datetimepicker({
               format: 'yyyy-mm-d hh:ii:ss',
               language:"zh-CN",
               minView:0,
               //startView:1,
               autoclose:true
           });


           $('.price').bind('blur',function(){
               if($(this).val() < 1) $(this).val(1);
               if($(this).val() > 200) $(this).val(200);
           })

        })   

    </script>

    <script src="{:config('__public__')}/static/jquery-ajaxFileUpload/ajaxfileupload.js" type="text/javascript"></script>
<script type="text/javascript">
        $(function () {
            $(":button").click(function () {
                ajaxFileUpload();
            })
        })
        function ajaxFileUpload() {
            $.ajaxFileUpload
            (
                {
                    url: '/index.php/admin/Upload/index', //用于文件上传的服务器端请求地址
                    secureuri: false, //是否需要安全协议，一般设置为false
                    fileElementId: 'file1', //文件上传域的ID
                    dataType: 'json', //返回值类型 一般设置为json
                    success: function (data, status)  //服务器成功响应处理函数
                    {
                        $("#img1").attr("src", data.imgurl);
                        if (typeof (data.error) != 'undefined') {
                            if (data.error != '') {
                                alert(data.error);
                            } else {
                                alert(data.msg);
                            }
                        }
                    },
                    error: function (data, status, e)//服务器响应失败处理函数
                    {
                        alert(e);
                    }
                }
            )
            return false;
        }
    </script>

</body>
</html>
